	$(function() {
		f_initGrid(contextPath + "/KhglAction?control=getKhList", null);
		});
	var manager, g;
	function f_initGrid(dataUrl, postParams)
	{ 
		g = manager = $("#maingrid").ligerGrid({
			columns: [
			{ display: '名称',  name: 'xm',editor: { type: 'text' }},
			{ display: '电话',  name: 'dh',editor: { type: 'text' }},
			{ display: 'QQ', name: 'qq',editor: { type: 'text' }},
			{ display: '性别',  name: 'xb',editor: { type: 'text' }},
			{ display: '年龄', name: 'nl',editor: { type: 'text' }},
			{ display: '地址',  name: 'dz',editor: { type: 'text' }},
			{ display: '备注',  name: 'bz',editor: { type: 'text' }},
			{ display: '录入时间',  name: 'lrsj',editor: { type: 'text' },render:function(value){
				return formatDate(value.lrsj,"yyyy-MM-dd HH:mm:ss");
			}}
			],
			enabledEdit: false, height: '95%', checkbox:true,rownumbers:true,
			parms:postParams,
			url :dataUrl,
			width: '100%'
		});   
	}
	
	function getSelected()
	{ 
		var row = manager.getSelectedRow();
		if (!row) { alert('请选择行'); return; }
		alert(JSON.stringify(row));
	}
	function getData()
	{ 
		var data = manager.getData();
		alert(JSON.stringify(data));
	} 